<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
	google.load("visualization", "1", {
		packages : [ "corechart" ]
	});
	google.setOnLoadCallback(drawChart);
	function drawChart() {
		var total = ${total};
		var bad = ${badcount};
		var good = ${goodcount};
		var data = google.visualization.arrayToDataTable([
				[ 'Task', 'Hours per Day' ], [ '총생산량', total ],
				[ '불량', bad ], 
				['정상',good]]);
		var options = {
			title : '총괄현황'
		};

		var chart = new google.visualization.PieChart(document
				.getElementById('chart_div'));
		chart.draw(data, options);
	}
</script>


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<script type="text/javascript">
	function A_Machine() {
		document.GC.action = "A.do";
		document.GC.submit();
	}

	function B_Machine() {
		document.GC.action = "B.do";
		document.GC.submit();
	}

	function C_Machine() {
		document.GC.action = "C.do";
		document.GC.submit();
	}
</script>

<body>
${title }


	<div id="chart_div" style="width: 500px; height: 300px;"></div>
	<h1 align="left">전체현황 차트보기</h1>
	<hr>
	<form action="allshowchart.do" method="post">

		<table border="2" width="800" height="300" align="center">

			<tr align="center">
				<td colspan="3"><font size="8" color="red"><strong>생산현황판</strong></font></td>
			</tr>
			<tr>
				<td align="center">목표</td>
				<td align="right">${controllertotal.total}</td>
			</tr>
			<tr>
				<td align="center">현재생산</td>
				<td align="right">${controllernowyes.total }</td>
			</tr>
			<tr>
				<td align="center">남은수량</td>
				<td align="right">${controllernowno}</td>
			</tr>
		</table>
		<hr>
	</form>
	<form name="GC">
		<hr>
		<span><img src="/MES_ADMIN_Project/img/A.jpg"
			onclick="A_Machine()"></img></span> <span><img
			src="/MES_ADMIN_Project/img/A.jpg" onclick="B_Machine()"></img></span> <span><img
			src="/MES_ADMIN_Project/img/A.jpg" onclick="C_Machine()"></img></span><br>
	</form>
</body>
</html>